module.exports = function (app) {
    var community = require('../controllers/community-controller');
    logger.debug("load the yellowPage-route module....");

    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityBulletin/:pageNo/:token/:deviceId', community.getCommunityBulletin);
    app.post('/rest/' + RESTFullServiceVersion + '/communities/postCommunityBulletin/:token/:deviceId', community.postCommunityBulletin);
    app.post('/rest/' + RESTFullServiceVersion + '/communities/postCommunityBulletinServiceByModerator/:token/:deviceId', community.postCommunityBulletinServiceByModerator);

    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityByCommunityId/:communityId/:token/:deviceId', community.getCommunityByCommunityId);
    app.get('/rest/' + RESTFullServiceVersion + '/communities/backOfficeGetCommunityDetail/:communityId', community.backOfficeGetCommunityDetail);

    app.get('/rest/' + RESTFullServiceVersion + '/communities/searchByCityAndName/:cityId/:communityName/:token/:deviceId', community.searchByCityAndName);

    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityPeopleNumber/:token/:deviceId', community.getCommunityPeopleNumber);
    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityUser/:ts/:token/:deviceId', community.getCommunityUser);

    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityListByCoordinate/:latitude/:longitude/:deviceId', community.getCommunityListByCoordinates);
    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityListByKeyword/:keyword/:latitude/:longitude/:deviceId', community.getCommunityListByKeyword);

    app.post('/rest/' + RESTFullServiceVersion + '/communities/postCommunityApplication/:token/:deviceId', community.postCommunityApplication);

    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityAroundList/:status/:pageNo/:token/:deviceId', community.getCommunityAroundList);
    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityAroundDetails/:id/:token/:deviceId', community.getCommunityAroundDetails);
    app.get('/rest/' + RESTFullServiceVersion + '/communities/getDetailCommunityBulletin/:bulletinId/:token/:deviceId', community.getDetailCommunityBulletin);

    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityTalent/:token/:deviceId', community.getCommunityTalent);
    app.get('/rest/' + RESTFullServiceVersion + '/communities/getCommunityTalentNew/:page/:token/:deviceId', community.getCommunityTalentNew);

    app.post('/rest/' + RESTFullServiceVersion + '/communities/postComment/:id/:token/:deviceId', community.postComment);
    app.post('/rest/' + RESTFullServiceVersion + '/communities/postCommunitySupplement/:token/:deviceId', community.postCommunitySupplement);


    //后台管理
    app.get('/rest/' + RESTFullServiceVersion + '/communities/getAllCommunity', community.getAllCommunity);

    app.get('/rest/' + RESTFullServiceVersion + '/communities/getAllCommunityGroups', community.getAllCommunityGroups);
    app.get('/rest/' + RESTFullServiceVersion + '/communities/getAllCommunityFromSQL', community.getAllCommunityFromSQL);


    app.get('/rest/' + RESTFullServiceVersion + '/communities/initCommunityAround', community.initCommunityAround);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/communities/getCommunitySupplementList/:communityId', community.getCommunitySupplementList)

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/updateCommunity/:communityId', community.updateCommunity);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/communities/getAllCommunityNotice/:communityId', community.getAllCommunityNotice);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/setNoticeStatus', community.setNoticeStatus);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/communities/addNoticeToFresh/:communityId/:noticeId', community.addNoticeToFresh);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/communities/deleteNotice/:noticeId', community.deleteNotice);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/communities/deleteNoticeByModerator/:noticeId/:communityId', community.deleteNoticeByModerator);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/communities/getNoticeById/:noticeId', community.getNoticeById);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/updateSupplementStatus/:supplementId', community.updateSupplementStatus);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/getCommunityGroups', community.getCommunityGroups);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/addCommunityGroup', community.addCommunityGroup);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/updateCommunityGroup', community.updateCommunityGroup);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/deleteCommunityGroup', community.deleteCommunityGroup);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/getCommunityGroupById', community.getCommunityGroupById);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/getCommunitiesByGroup', community.getCommunitiesByGroup);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/deleteCommunityGroups', community.deleteCommunityGroups);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/getIsOpenCommunityByName', community.getIsOpenCommunityByName);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/communities/insertCommunityGroups', community.insertCommunityGroups);

    /*  宝宝树66小区二次改造    add   guo.xiaomin  20170825  start   */
    app.post('/rest/' + RESTFullServiceVersion + '/communities/exportModeratorManagerInfoData', community.exportModeratorManagerInfoData); // 生成小区大使信息Excel
    /*  宝宝树66小区二次改造    add   guo.xiaomin  20170825  end   */

    /*  宝宝树66小区二次改造    add   guo.xiaomin  20170912  start   */
    app.get('/rest/' + RESTFullServiceVersion + '/communities/downLoadModeratorManagerInfoData', community.downLoadModeratorManagerInfoData); // 生成小区大使信息Excel
    /*  宝宝树66小区二次改造    add   guo.xiaomin  20170912  end   */

};